import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class ChatCommandParser {
	public static void main(String[] arg) {
		//System.out.println(Pattern.compile("^/.*$").matcher("/asd").matches());
		//System.out.println(Pattern.compile("^/(.*)$").matcher("/asd").group());
		Pattern pattern = Pattern.compile("^/(\\w+).*$");
		Matcher matcher = pattern.matcher("/w asd asd");
		if (matcher.matches()) {
			System.out.println(matcher.group(1));
		}
	}
}
